package com.ssy.lingxi.report.repository.report;

import com.ssy.lingxi.report.entity.report.PurchaseDayReportDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.time.LocalDateTime;
import java.util.List;

/**
 *  采购日报表
 * @author ds
 * @date 2021/7/3
 * @version 2.0.0
 */
public interface PurchaseDayReportRepository extends JpaRepository<PurchaseDayReportDO, Long>, JpaSpecificationExecutor<PurchaseDayReportDO> {

    /**
     * 删除指定范围订单日报表
     * @author ds
     * @date 2021/7/3
     * @param startTime:
     * @param endTime:
     * @return void
     **/
    void deleteByDateTimeBetween(LocalDateTime startTime, LocalDateTime endTime);

    /**
     * 查询指定范围订单日统计数据
     * @author ds
     * @date 2021/7/3
     * @param startTime:
     * @param endTime:
     * @return java.util.List<com.ssy.lingxi.report.entity.report.PurchaseDayReportDO>
     **/
    List<PurchaseDayReportDO> getAllByDateTimeBetween(LocalDateTime startTime, LocalDateTime endTime);
    /**
     * 查询指定范围订单日统计数据
     * @author ds
     * @date 2021/7/3
     * @param dateTime:指定日期，例：2021-7-3 00:00:00
     * @return java.util.List<com.ssy.lingxi.report.entity.report.PurchaseDayReportDO>
     **/
    List<PurchaseDayReportDO> getAllByDateTime(LocalDateTime dateTime);

    /**
     * 根据报表时间查询日报表
     * @author ds
     * @date 2021/7/3
     * @param time: 报表时间
     * @return 日报表
     **/
    PurchaseDayReportDO findFirstByDateTime(LocalDateTime time);
}

